<?php

namespace app\cps\controller;

use app\cps\service\CostInfoService;
use think\facade\Request;
use app\common\Error;
use app\common\Common;


/**
 * 实时在投消耗详情
 */
class CostInfo extends Base
{
    private $service;

    public function __construct(CostInfoService $service)
    {
        parent::__construct();
        $this->service = $service;
    }
    /**
     * 巨量实时在投详情时间段数据
     *
     * @return void
     */
    public function detailTiktok(){

        try{
            $params = Request::param();
            $data = $this->service->getTiktokAdvData($params, $this->getUserInfo());
            if (!empty($data['message'])) {
                return Common::fail($data['message']);
            }
            return Common::success($data);
        } catch (\Exception $e) {
            return Common::fail($e->getMessage());
        }
    }
}
